home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Id: v384.trm,v 1.6 1995/12/20 21:48:19 drd Exp $
- *
- */
-
- /* GNUPLOT - v384.trm */
- /*
- * Copyright (C) 1990 - 1993
- *
- * Permission to use, copy, and distribute this software and its
- * documentation for any purpose with or without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and
- * that both that copyright notice and this permission notice appear
- * in supporting documentation.
- *
- * Permission to modify the software is granted, but not the right to
- * distribute the modified code. Modifications are to be distributed
- * as patches to released version.
- *
- * This software is provided "as is" without express or implied warranty.
- *
- * This file is included by ../term.c.
- *
- * This terminal driver supports:
- * Vectrix 384 - works with tandy color printer as well
- *
- * AUTHORS
- * roland@moncskermit.OZ (Roland Yap)
- *
- * send your comments or suggestions to (info-gnuplot@dartmouth.edu).
- *
- */
-
- /*
- * Vectrix 384 driver - works with tandy color printer as well
- * in reverse printing 8 color mode.
- * This doesn't work on Vectrix 128 because it redefines the
- * color table. It can be hacked to work on the 128 by changing
- * the colours but then it will probably not print best. The color
- * table is purposely designed so that it will print well
- *
- */
-
- /*
- * adapted to the new terminal layout by Stefan Bodewig (Dec. 1995)
- */
-
- #ifndef GOT_DRIVER_H
- #include "driver.h"
- #endif
-
- #ifdef TERM_REGISTER
- register_term(vx384)
- #endif
-
- #ifdef TERM_PROTO
- TERM_PUBLIC void V384_init __P((void));
- TERM_PUBLIC void V384_graphics __P((void));
- TERM_PUBLIC void V384_text __P((void));
- TERM_PUBLIC void V384_linetype __P((int linetype));
- TERM_PUBLIC void V384_move __P((unsigned int x, unsigned int y));
- TERM_PUBLIC void V384_vector __P((unsigned int x, unsigned int y));
- TERM_PUBLIC void V384_put_text __P((unsigned int x, unsigned int y, char str[]));
- TERM_PUBLIC void V384_reset __P((void));
-
- #define V384_XMAX 630
- #define V384_YMAX 480
-
- #define V384_XLAST (V384_XMAX - 1)
- #define V384_YLAST (V384_YMAX - 1)
-
- #define V384_VCHAR 12
- #define V384_HCHAR 7
- #define V384_VTIC 8
- #define V384_HTIC 7
- #endif /* TERM_PROTO */
-
- #ifndef TERM_PROTO_ONLY
- #ifdef TERM_BODY
-
- TERM_PUBLIC void V384_init()
- {
- fprintf(outfile,"%c%c G0 \n",27,18);
- fprintf(outfile,"Q 0 8\n");
- fprintf(outfile,"0 0 0\n");
- fprintf(outfile,"255 0 0\n");
- fprintf(outfile,"0 255 0\n");
- fprintf(outfile,"0 0 255\n");
- fprintf(outfile,"0 255 255\n");
- fprintf(outfile,"255 0 255\n");
- fprintf(outfile,"255 255 0\n");
- fprintf(outfile,"255 255 255\n");
- }
-
-
- TERM_PUBLIC void V384_graphics()
- {
- fprintf(outfile,"%c%c E0 RE N 65535\n",27,18);
- }
-
-
- TERM_PUBLIC void V384_text()
- {
- fprintf(outfile,"%c%c\n",27,17);
- }
-
-
- TERM_PUBLIC void V384_linetype(linetype)
- int linetype;
- {
- static int color[]= {
- 1 /* red */,
- 2 /* green */,
- 3 /* blue */,
- 4 /* cyan */,
- 5 /* magenta */,
- 6 /* yellow */, /* not a good color so not in use at the moment */
- 7 /* white */
- };
-
- if (linetype < 0)
- linetype=6;
- else
- linetype %= 5;
- fprintf(outfile,"C %d\n",color[linetype]);
- }
-
-
- TERM_PUBLIC void V384_move(x,y)
- unsigned int x,y;
- {
- fprintf(outfile,"M %d %d\n",x+20,y);
- }
-
-
- TERM_PUBLIC void V384_vector(x,y)
- unsigned int x,y;
- {
- fprintf(outfile,"L %d %d\n",x+20,y);
- }
-
-
- TERM_PUBLIC void V384_put_text (x, y, str)
- unsigned int x, y;
- char str[];
- {
- V384_move (x, y + V384_VCHAR/2);
- fprintf (outfile, "$%s\n", str);
- }
-
-
- TERM_PUBLIC void V384_reset()
- {
- }
-
- #endif /* TERM_BODY */
-
- #ifdef TERM_TABLE
-
- TERM_TABLE_START(vx384_driver)
- "vx384", "Vectrix 384 and Tandy color printer",
- V384_XMAX, V384_YMAX, V384_VCHAR, V384_HCHAR,
- V384_VTIC, V384_HTIC, options_null, V384_init, V384_reset,
- V384_text, null_scale, V384_graphics, V384_move, V384_vector,
- V384_linetype, V384_put_text, null_text_angle,
- null_justify_text, do_point, do_arrow, set_font_null
- TERM_TABLE_END(vx384_driver)
-
- #undef LAST_TERM
- #define LAST_TERM vx384_driver
-
- #endif /* TERM_TABLE */
- #endif /* TERM_PROTO_ONLY */
-
- /*
- * NAME: vx384
- *
- * OPTIONS: none
- *
- * SUPPORTS: Vectrix 384 and Tandy color printer
- *
- * Further Info: from top of file
- * Vectrix 384 driver - works with tandy color printer as well
- * in reverse printing 8 color mode.
- * This doesn't work on Vectrix 128 because it redefines the
- * color table. It can be hacked to work on the 128 by changing
- * the colours but then it will probably not print best. The color
- * table is purposely designed so that it will print well
- *
- */